/* 面谈记录 */
import { ajaxService } from '@/utils/request';
import * as typeObj from './type';

const env = import.meta.env;
const baseURL = env.VITE_DEV_BASE_URL;

/**
 * 获取面谈记录列表
 * @param params
 * @returns
 */
export function getInterviewRecordList(params: typeObj.Params) {
  return ajaxService<typeObj.InterviewList>({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/record/list',
    method: 'get',
    baseURL: baseURL,
    params
  });
}

/**
 * 删除面谈记录
 * @param data
 * @returns
 */
export function delInterviewRecord(data: { ids: number[] }) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/record/delete',
    method: 'delete',
    baseURL: baseURL,
    data
  });
}
/**
 * 删除面谈记录的问题
 * @param data
 * @returns
 */
export function delQuestionOfInterviewRecord(data: { ids: number[] }) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/question/delete',
    method: 'delete',
    baseURL: baseURL,
    data
  });
}
/**
 * 删除面谈记录的项目
 * @param data
 * @returns
 */
export function delProjectOfInterviewRecord(data: { ids: number[] }) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/item/delete',
    method: 'delete',
    baseURL: baseURL,
    data
  });
}

/**
 * 新增面谈记录
 * @param data
 * @returns
 */
export function addInterviewRecord(data: typeObj.InterviewList) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/record/add',
    method: 'post',
    baseURL: baseURL,
    data
  });
}
/**
 * 修改面谈记录
 * @param data
 * @returns
 */
export function editInterviewRecord(data: typeObj.InterviewList) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/record/update',
    method: 'put',
    baseURL: baseURL,
    data
  });
}

/**
 * 面谈记录查重
 * @param params
 * @returns
 */
export function interviewRecordRepeat(params: { name: string }) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/record/repeat',
    method: 'get',
    baseURL: baseURL,
    params
  });
}
/**
 * 面谈记录：项目查重
 * @param params
 * @returns
 */
export function interviewRecordProjectRepeat(params: { name: string }) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/item/repeat',
    method: 'get',
    baseURL: baseURL,
    params
  });
}
/**
 * 面谈记录：问题查重
 * @param params
 * @returns
 */
export function interviewRecordQuestionRepeat(params: { name: string }) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/question/repeat',
    method: 'get',
    baseURL: baseURL,
    params
  });
}
/**
 * 面谈记录详情
 * @param params
 * @returns
 */
export function getInterviewRecordById(params: { id: number }) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/interview_record/record/detail',
    method: 'get',
    baseURL: baseURL,
    params
  });
}
